<template>
  <ViewBg ref="viewBgRef" />
  <ViewZj ref="viewZjRef" />
  <ViewJx ref="viewJxRef" />
  <CheckBg ref="checkBgRef" @check-success="checkSuccess" />
  <CheckZj ref="checkZjRef" @check-success="checkSuccess" />
  <CheckJx ref="checkJxRef" @check-success="checkSuccess" />
</template>

<script setup>
import ViewBg from "@/views/project/pages/xmbg/components/ViewModal.vue";
import ViewZj from "@/views/project/components/xmzj/ViewModal.vue";
import ViewJx from "@/views/project/components/xmjx/ViewModal.vue";
import CheckBg from "@/views/project/pages/xmbg/components/CheckModal.vue";
import CheckZj from "@/views/project/components/xmzj/CheckModal.vue";
import CheckJx from "@/views/project/components/xmjx/CheckModal.vue";
const viewBgRef = ref();
const viewZjRef = ref();
const viewJxRef = ref();
const checkBgRef = ref();
const checkZjRef = ref();
const checkJxRef = ref();
const view = (type, proId, id, proClass) => {
  if (type == "项目变更") {
    viewBgRef.value.view(id, proClass);
  } else if (type == "项目中检") {
    viewZjRef.value.view(proId, id);
  } else if (type == "项目结项") {
    viewJxRef.value.view(proId, id);
  }
};
const check = (type, proId, id, processId, proClass) => {
  if (type == "项目变更") {
    checkBgRef.value.check(id, proClass, processId);
  } else if (type == "项目中检") {
    checkZjRef.value.check(proId, id, processId);
  } else if (type == "项目结项") {
    checkJxRef.value.check(proId, id, processId);
  }
};
defineExpose({ view, check });
const emit = defineEmits(["check-success"]);
const checkSuccess = () => {
  emit("check-success");
};
</script>

<style scoped lang="scss"></style>
